package com.learn.spring5.testdemo;

import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import com.learn.spring5.bean.Emp;
import com.learn.spring5.service.UserService;

public class TestBean
{
	@Test
	public void testBean1()
	{
		@SuppressWarnings("resource")
		ApplicationContext context = new ClassPathXmlApplicationContext("bean2.xml");
		UserService userService = context.getBean("userService", UserService.class);
		userService.add();
	}

	@Test
	public void testBean2()
	{
		@SuppressWarnings("resource")
		ApplicationContext context = new ClassPathXmlApplicationContext("bean3.xml");
		Emp emp = context.getBean("emp", Emp.class);
		emp.add();
	}
	
	@Test
	public void testBean3()
	{
		@SuppressWarnings("resource")
		ApplicationContext context = new ClassPathXmlApplicationContext("bean4.xml");
		Emp emp = context.getBean("emp", Emp.class);
		emp.add();
	}
}
